import { uniFetch } from "@/pages/api/http.js";

// 获取报修工单列表
export const getRepairOrderList = (params) => {
  return uniFetch({
    url: "/blade-repair/repairOrder/list",
    method: "GET",
    data: params,
  });
};

// 获取故障库列表
export const getFaultLibraryList = (params) => {
  return uniFetch({
    url: "/blade-repair/repairLibrary/list",
    method: "GET",
    data: params,
  });
};

// 获取维修班组列表
export const getRepairTeamList = (params) => {
  return uniFetch({
    url: "/repair-team/list",
    method: "GET",
    data: params,
  });
};

// 获取设备列表
export const getDeviceList = (params) => {
  return uniFetch({
    url: "/blade-device/deviceInfo/list",
    method: "GET",
    data: params,
  });
};

// 获取部门列表
export const getDepartmentList = () => {
  return uniFetch({
    url: "/blade-system/dept/list",
    method: "GET",
  });
};

// 获取故障类型列表
export const getFaultTypeList = () => {
  return uniFetch({
    url: "/blade-repair/repairType/lazyList",
    method: "GET",
  });
};

// 保存报修申请
export const saveRepairApply = (data) => {
  return uniFetch({
    url: "/blade-repair/repairApply/save",
    method: "post",
    data,
  });
};

// 获取报修工单详情
export const getRepairOrderDetail = (id) => {
  return uniFetch({
    url: `/blade-repair/repairOrder/detail`,
    method: "GET",
    data: { id },
  });
};
